var v = new Vue({
	el:"#login",
	data:{},
	methods:{
		login:function(){
			$.post(
				"/index.php/Login/login",
				{
					name:$("#name").val(),
					password:$("#password").val()
				},
				function(ret){
					if(ret.status == "success"){
						setTimeout(function(){
							window.location.href="/h/index.html";
						},1500);
						layer.msg(ret.data,{icon:1});
					}else if(ret.status == "failed"){
						layer.msg(ret.data,{icon:2});
					}
				}

			);
		},
		msg:function(event){
			var ipt = $($(event)[0].path[0]);
			if(ipt.attr('id') == "name"){
				if(ipt.val().length < 6){
					layer.tips("用户名不能少于6位","#name");
				}
			}else if(ipt.attr('id') == "password"){
				if(ipt.val().length < 6){
					layer.tips("密码不能少于6位","#password");
				}
			}
		}
	},
	ready:function(){

	}
});